<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head th:replace="/layout :: htmlhead" th:with="title='后台管理'">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-form-item" lay-filter="searchForm">
                <form class="layui-form" method="post">
                    <label class="layui-form-label">查验机构</label>
                    <div class="layui-input-inline">
                        <select id="cyqxhSearch">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <label class="layui-form-label">查验员姓名</label>
                    <div class="layui-input-inline">
                        <input id="usernameSearch"  class="layui-input" type="text"/>
                    </div>
                    <label class="layui-form-label">警员编号</label>
                    <div class="layui-input-inline">
                        <input id="jybhSearch" class="layui-input" type="text"/>
                    </div>
                </form>
                <div class="layui-input-inline">
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    <button class="layui-btn" lay-submit="" lay-filter="searchSubmit">查询</button>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-body">
                    <table class="layui-hide" id="table" lay-filter="table"></table>
                    <script type="text/html" id="table-title">
                        <h2><b>查验员列表</b>&nbsp;&nbsp;&nbsp;<a class="layui-btn layui-btn-normal layui-btn-xs"
                                                               onclick="openAdd()"
                                                               shiro:hasPermission="cyuser:add">新建</a></h2>
                    </script>
                    <script type="text/html" id="table-toolbar">
                        <a class="layui-btn layui-btn-xs" lay-event="edit"
                           shiro:hasPermission="cyuser:edit">编辑</a>
                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                           shiro:hasPermission="cyuser:del">删除</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="cyuserEdit" class="layer_self_wrap" style="display:none;">
    <form id="cyuserForm" lay-filter="cyuserForm" class="layui-form layui-form-pane" method="post" style="margin-top: 20px;" action="">
        <input id="id" name="id" type="hidden"/>
        <input type="hidden" id="oper" >
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 27%">查验机构</label>
            <div class="layui-input-inline" style="width: 55%;">
                <input id="cyqxh" name="cyqxh" type="hidden"/>
                <input id="cyqmc" name="cyqmc" lay-verify="required" class="layui-input" type="button" onclick="openOrganTree()"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 27%">查验员姓名</label>
            <div class="layui-input-inline" style="width: 55%;">
                <input name="cyyxm" lay-verify="required"  class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 27%">身份证号码</label>
            <div class="layui-input-inline" style="width: 55%;">
                <input name="cyysfzhm" lay-verify="identity"  class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 27%">查验员职称</label>
            <div class="layui-input-inline" style="width: 55%;">
                <select name="cyyzc">
                    <option value="1">初级查验员</option>
                    <option value="2">中级查验员</option>
                    <option value="3">高级查验员</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 27%">警员编号</label>
            <div class="layui-input-inline" style="width: 55%;">
                <input name="jybh" lay-verify="jingbh"  class="layui-input" type="text"/>
            </div>
        </div>
        <div class="layui-form-item" >
            <label class="layui-form-label" style="width: 27%">查验员照片</label>
            <div class="layui-input-inline" style="width: 55%;">
                <img id="headimg" src="" style="height: 150px">
                <button type="button" class="layui-btn" id="test1" style="float: right; margin-right: 70px;margin-top:10px">
                    <i class="layui-icon">&#xe67c;</i>上传图片
                </button>
            </div>
        </div>
        <div class="layui-form-item"style="float: right; margin-right: 70px;margin-top:10px">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submitUser" >确定</button>
                <button type="button" class="layui-btn layui-btn-primary"  onclick="submitCancel()" >取消</button>
            </div>
        </div>
    </form>
</div>
<script>
    layui.use(['form', 'layedit', 'laydate'],function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        var editIndex = layedit.build('LAY_demo_editor');
        //    自定义验证
        form.verify({
            jingbh: [
                /^[a-zA-Z0-9]{0,9}$/
                , '警员编号不超过10位'
            ]
        })
    })
</script>
<div id="organDiv" class="layer_self_wrap" style="display:none;">
    <div id="organTree"></div>
</div>
<script th:src="@{/js/systemManager/cyuser.js}"></script>
</body>
</html>